package com.ys.controller.api.storage;

import com.ys.config.MenuId;
import com.ys.entity.storage.TccChannelType;
//import com.ys.service.storage.TccChannelTypeService;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.LayuiTableVoJA;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/api/inter/tccChannelType")
public class ApiInterTccChannelTypeController {
	private static final Logger logger = LoggerFactory.getLogger(ApiInterTccChannelTypeController.class);
	
	@Autowired
	private CommonApiService<TccChannelType> commonApiService;

//	@RequiresPermissions("tpFbaPlanOrder:view")
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(@ModelAttribute TccChannelType cond){
		
		commonApiService.dataAuth(MenuId.TCC_ChannelType, cond);
		cond.addField("A.ValueCode valueCode,A.Id id");
		cond.setOrderby("A.Id desc");
		cond.where("A.Jstype=1 ");


		return commonApiService.searchLay(cond);
	}
	@RequestMapping("/search2")
	@ResponseBody
	public LayuiTableVoJA search2(@ModelAttribute TccChannelType cond){

		commonApiService.dataAuth(MenuId.TCC_ChannelType, cond);
		cond.addField("A.ValueCode valueCode,A.Id id");
		cond.setOrderby("A.Id desc");
		cond.where("A.Jstype=2 ");


		return commonApiService.searchLay(cond);
	}
	@RequestMapping("/search3")
	@ResponseBody
	public LayuiTableVoJA search3(@ModelAttribute TccChannelType cond){

		commonApiService.dataAuth(MenuId.TCC_ChannelType, cond);
		cond.addField("A.ValueCode valueCode,A.Id id");
		cond.setOrderby("A.Id desc");
		cond.where("A.Jstype=3 ");


		return commonApiService.searchLay(cond);
	}
	@RequestMapping("/search4")
	@ResponseBody
	public LayuiTableVoJA search4(@ModelAttribute TccChannelType cond){

		commonApiService.dataAuth(MenuId.TCC_ChannelType, cond);
		cond.addField("A.ValueCode valueCode,A.Id id");
		cond.setOrderby("A.Id desc");
		cond.where("A.Jstype=4 ");


		return commonApiService.searchLay(cond);
	}
	@RequestMapping("/search5")
	@ResponseBody
	public LayuiTableVoJA search5(@ModelAttribute TccChannelType cond){

		commonApiService.dataAuth(MenuId.TCC_ChannelType, cond);
		cond.addField("A.ValueCode valueCode,A.Id id");
		cond.setOrderby("A.Id desc");
		cond.where("A.Jstype=5 ");


		return commonApiService.searchLay(cond);
	}
}
